<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
  @namespace xlink "http://www.w3.org/1999/xlink";
  #svg
  {
    fill: lime;
  }
  #svg:not(.c) > [xlink|href="#model"]
  {
    fill: red;
  }
</style>
<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <g id="model"/>
  <use id="target" xlink:href="#model"/>
</svg>
<script>
  test(function() {
    assert_equals(getComputedStyle(target).fill, "rgb(255, 0, 0)");
    document.getElementById('svg').classList.add('c');
    assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2);
    assert_equals(getComputedStyle(target).fill, "rgb(0, 255, 0)");
  }, "Test that invalidation occurs for namespaced attributes.");
</script>
